
import arrMath from "./arrMath"
declare global {
    interface Window {
        awaitTime(v: number): void
    }
    interface Number {
        clamp(min: number, max: number): number
    }
}
window.awaitTime = function (v: number) {
    return new Promise((resolve) => {
        const sto = setTimeout(() => {
            resolve(0)
            clearTimeout(sto)
        }, v)
    })
}
Number.prototype.clamp = function (min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
    let v = this.valueOf()
    if (v < min) v = min
    if (v > max) v = max
    return v
}

export default class Base {
    static init() {
        arrMath()
    }
}